//
//  BTEUploadTool.swift
//  BTE
//
//  Created by Mike Zhang on 2025/8/5.
//

import Foundation
import Alamofire



enum BTEUPLoadTool_API: SERVER_NET_TYPE {
    
    case oversoaking([String:String])
    case dinarzade([String:String])
    case impersonative([String:String])
    case blytheville([String:String])
    case plectra([String:String])
    
    var ROOT: String {
        return ROOT_PATH
    }
    
    
    var PATH: String {
        switch self {
        case .oversoaking:
            return "/Blaugas/oversoaking"
        case .dinarzade:
            return "/Blaugas/dinarzade"
        case .impersonative:
            return "/Blaugas/impersonative"
        case .blytheville:
            return "/Blaugas/blytheville"
        case .plectra:
            return "/Blaugas/plectra"
        }
    }
    
    
    var METHOD: SERVER_NET_F {
        switch self {
        case .oversoaking:
            return .POST
        case .dinarzade:
            return .POST
        case .impersonative:
            return .POST
        case .blytheville:
            return .POST
        case .plectra:
            return .POST
        }
    }
    
    
    var TASK: SERVER_TASK {
        switch self {
        case .oversoaking(let dic):
            return .requestParameters(parameters: dic, encoding:URLEncoding.httpBody)
        case .dinarzade(let dic):
            return .requestParameters(parameters: dic, encoding:URLEncoding.httpBody)
        case .impersonative(let dic):
            return .requestParameters(parameters: dic, encoding:URLEncoding.httpBody)
        case .blytheville(let dic):
            return .requestParameters(parameters: dic, encoding:URLEncoding.httpBody)
        case .plectra(let dic):
            return .requestParameters(parameters: dic, encoding:URLEncoding.httpBody)
        }
    }
    
    
    var HEADER: [String : String]? {
        return nil
    }
    
}




class BTEUploadToolNetServer: BTEServiceTool<BTEUPLoadTool_API> {
 
    
    func oversoaking(data:[String:String],completion: @escaping (Result<NetBaseModel<BaseEmptyModel>?, NetError>) -> Void) {
        fetchData(target: BTEUPLoadTool_API.oversoaking(data), resultClass: NetBaseModel<BaseEmptyModel>.self) { result in
            completion(result)
        }
    }
    
    func dinarzade(data:[String:String],completion: @escaping (Result<NetBaseModel<BaseEmptyModel>?, NetError>) -> Void) {
        fetchData(target: BTEUPLoadTool_API.dinarzade(data), resultClass: NetBaseModel<BaseEmptyModel>.self) { result in
            completion(result)
        }
    }
    
    func impersonative(data:[String:String],completion: @escaping (Result<NetBaseModel<BaseEmptyModel>?, NetError>) -> Void) {
        fetchData(target: BTEUPLoadTool_API.impersonative(data), resultClass: NetBaseModel<BaseEmptyModel>.self) { result in
            completion(result)
        }
    }
    
    func blytheville(data:[String:String],completion: @escaping (Result<NetBaseModel<BaseEmptyModel>?, NetError>) -> Void) {
        fetchData(target: BTEUPLoadTool_API.blytheville(data), resultClass: NetBaseModel<BaseEmptyModel>.self) { result in
            completion(result)
        }
    }
    
    func plectra(data:[String:String],completion: @escaping (Result<NetBaseModel<BaseEmptyModel>?, NetError>) -> Void) {
        fetchData(target: BTEUPLoadTool_API.plectra(data), resultClass: NetBaseModel<BaseEmptyModel>.self) { result in
            completion(result)
        }
    }
}
